package com.system.announcement.dao;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

import com.system.announcement.entity.Announcement;


@Repository
public interface AnnouncementRepository extends PagingAndSortingRepository<Announcement, Long>,JpaSpecificationExecutor<Announcement>{
	@Query("from Announcement a1 where a1.id=(select max(a2.id) from Announcement a2)")
	public Announcement findLast();
	
}
